public class AlternatingOffersProtocol extends Protocol
BilateralAtomicNegotiationSession.
Manages time-outs.| Modifier and Type | Field and Description |
|---|---|
protected Agent |
agentA |
protected Agent |
agentB |
static int |
ALTERNATING_OFFERS_AGENT_A_INDEX |
static int |
ALTERNATING_OFFERS_AGENT_B_INDEX |
protected java.lang.String |
startingAgent |
domain, negoThread, sessionNr, stopNegotiation, totalSessions, tournamentRunner| Constructor and Description |
|---|
AlternatingOffersProtocol(AgentRepItem[] agentRepItems,
ProfileRepItem[] profileRepItems,
java.util.HashMap<AgentParameterVariable,AgentParamValue>[] agentParams,
int totalSessionRounds)
RUN A NEGO SESSION.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addNegotiationPaths(int sessionNumber,
java.util.ArrayList<BidPoint> pAgentABids,
java.util.ArrayList<BidPoint> pAgentBBids)
Call this method to draw the negotiation paths on the chart with analysis.
|
protected static java.util.ArrayList<AlternatingOffersProtocol> |
allParameterCombis(Tournament tournament,
AgentRepItem agentA,
AgentRepItem agentB,
ProfileRepItem profileA,
ProfileRepItem profileB)
This is a recursive function that iterates over all *parameters* and tries all values for each,
recursively calling itself to iterate over the remaining parameters.
|
protected static void |
allParameterCombis(Tournament tournament,
java.util.ArrayList<AssignedParameterVariable> allparameters,
java.util.ArrayList<AlternatingOffersProtocol> sessions,
ProfileRepItem profileA,
ProfileRepItem profileB,
AgentRepItem agentA,
AgentRepItem agentB,
java.util.ArrayList<AssignedParamValue> chosenvalues)
adds all permutations of all NegotiationSessions to the given sessions array.
|
static void |
closeLog(boolean extensive) |
void |
createExtraLogData()
Append quality measure information to the additional
outcome field. |
Agent |
getAgent(int index) |
java.lang.String |
getAgentAname() |
java.util.HashMap<AgentParameterVariable,AgentParamValue> |
getAgentAparams() |
AgentRepItem |
getAgentARep() |
java.lang.String |
getAgentAStrategyName() |
UtilitySpace |
getAgentAUtilitySpace() |
java.lang.String |
getAgentBname() |
java.util.HashMap<AgentParameterVariable,AgentParamValue> |
getAgentBparams() |
AgentRepItem |
getAgentBRep() |
java.lang.String |
getAgentBStrategyName() |
UtilitySpace |
getAgentBUtilitySpace() |
Domain |
getDomain() |
java.lang.String |
getName() |
NegotiationOutcome |
getNegotiationOutcome() |
java.lang.String |
getOutcome() |
ProfileRepItem |
getProfileArep() |
ProfileRepItem |
getProfileBrep() |
AlternatingOffersBilateralAtomicNegoSession |
getSessionRunner() |
java.lang.String |
getStartingAgent() |
java.lang.Integer |
getTotalTime() |
static java.util.ArrayList<Protocol> |
getTournamentSessions(Tournament tournament)
Called when you press start button in Tournament window via reflection in
TournamentRunner. |
static java.util.ArrayList<Protocol> |
getTournamentSessions(Tournament tournament,
boolean selfplay,
boolean both_sides) |
protected AlternatingOffersBilateralAtomicNegoSession |
newAlternatingOffersBilateralAtomicNegoSession() |
void |
run()
Warning.
|
protected void |
runNegotiationSession()
Run a negotiation session.
|
void |
startNegotiation()
this runs sessionTotalNumber of sessions with the provided settings
|
void |
stopNegotiation() |
java.lang.String |
toString() |
addNegotiationEventListener, fireBilateralAtomicNegotiationSessionEvent, fireLogMessage, fireNegotiationActionEvent, getAgentName, getAgentParams, getAgentRepItem, getAgentUtilitySpaces, getNegotiationEventListeners, getNumberOfAgents, getProfileRepItems, getSessionNumber, getTotalSessions, hashCode, loadAgentsUtilitySpaces, removeNegotiationEventListener, setTournamentRunner, startSessionpublic static final int ALTERNATING_OFFERS_AGENT_A_INDEX
public static final int ALTERNATING_OFFERS_AGENT_B_INDEX
protected java.lang.String startingAgent
protected Agent agentA
protected Agent agentB
public AlternatingOffersProtocol(AgentRepItem[] agentRepItems, ProfileRepItem[] profileRepItems, java.util.HashMap<AgentParameterVariable,AgentParamValue>[] agentParams, int totalSessionRounds) throws java.lang.Exception
java.lang.Exceptionpublic void run()
public void startNegotiation()
throws java.lang.Exception
java.lang.Exceptionprotected void runNegotiationSession()
throws java.lang.Exception
nr - is the sessionTestNumberjava.lang.Exceptionpublic void createExtraLogData()
outcome field.protected AlternatingOffersBilateralAtomicNegoSession newAlternatingOffersBilateralAtomicNegoSession() throws java.lang.Exception
java.lang.Exceptionpublic static void closeLog(boolean extensive)
public void stopNegotiation()
stopNegotiation in class Protocolpublic java.lang.String getOutcome()
public void addNegotiationPaths(int sessionNumber,
java.util.ArrayList<BidPoint> pAgentABids,
java.util.ArrayList<BidPoint> pAgentBBids)
pAgentABids - pAgentBBids - public UtilitySpace getAgentAUtilitySpace()
public UtilitySpace getAgentBUtilitySpace()
public java.lang.String getAgentAname()
public java.lang.String getAgentBname()
public java.util.HashMap<AgentParameterVariable,AgentParamValue> getAgentAparams()
public java.util.HashMap<AgentParameterVariable,AgentParamValue> getAgentBparams()
public ProfileRepItem getProfileArep()
public ProfileRepItem getProfileBrep()
public AgentRepItem getAgentARep()
public AgentRepItem getAgentBRep()
public java.lang.String getAgentAStrategyName()
public java.lang.String getAgentBStrategyName()
public java.lang.Integer getTotalTime()
public java.lang.String getStartingAgent()
public AlternatingOffersBilateralAtomicNegoSession getSessionRunner()
public NegotiationOutcome getNegotiationOutcome()
getNegotiationOutcome in class Protocolpublic Agent getAgent(int index)
public static java.util.ArrayList<Protocol> getTournamentSessions(Tournament tournament) throws java.lang.Exception
TournamentRunner.
This builds the sessions array from given Tournament vars
The procedure skips sessions where both sides use the same preference profiles.exception - if something wrong with the variables, eg not set.java.lang.Exceptionpublic static java.util.ArrayList<Protocol> getTournamentSessions(Tournament tournament, boolean selfplay, boolean both_sides) throws java.lang.Exception
java.lang.Exceptionprotected static java.util.ArrayList<AlternatingOffersProtocol> allParameterCombis(Tournament tournament, AgentRepItem agentA, AgentRepItem agentB, ProfileRepItem profileA, ProfileRepItem profileB) throws java.lang.Exception
sessions - is the final result: all valid permutations of variables.varnr - is the index of the variable in the variables array.exception - if one of the variables contains no values (which would prevent any
running sessions to be created with that variable.java.lang.Exceptionprotected static void allParameterCombis(Tournament tournament, java.util.ArrayList<AssignedParameterVariable> allparameters, java.util.ArrayList<AlternatingOffersProtocol> sessions, ProfileRepItem profileA, ProfileRepItem profileB, AgentRepItem agentA, AgentRepItem agentB, java.util.ArrayList<AssignedParamValue> chosenvalues) throws java.lang.Exception
allparameters - the parameters of the agents that were selected for this nego session.sessions - java.lang.Exception